package cn.itcast.itcaststore.serive;

import cn.itcast.itcaststore.domain.Orders;
import cn.itcast.itcaststore.domain.User;

import java.sql.SQLException;
import java.util.List;

public interface OrderService {
    /**
     * 展示订单
     * @return
     * @throws SQLException
     */
    List<Orders> findAllOrder() throws SQLException;

    /**
     * 根据订单id和收件人搜索订单
     * @param orderId
     * @param receiverName
     * @return
     */
    List<Orders> findOrderByManyCondition(String orderId, String receiverName);

    /**
     * 查看订单详情
     * @param orderId
     * @return
     */
    Orders findOrderById(String orderId);

    /**
     * 后台根据id删除订单
     * @param orderId
     */
    void delOrderById(String orderId);

    /**
     * 前台根据id删除订单
     * @param orderId
     */
    void delOrderByIdWithClient(String orderId);


    /**
     * 添加订单操作
     * @param order
     */
    void addOrder(Orders order);
    /*
     * 查询用户下的所属订单
     *
     * */
    List<Orders> findOrderByUser(final User user) throws SQLException;
    /*
     * 根据订单号修改订单状态
     * @param id
     * @throws SQLException
     * */
    void updateOrderState(String id) throws SQLException;
    /*
     * 	支付成功后修改订单状态
     * */
    void updateState(String r6_order);
}
